package org.vartist.atld.menu.generator;

import java.util.ArrayList;

import org.vartist.atld.R;
import org.vartist.atld.menu.activity.main.MainActivity;
import org.vartist.atld.menu.activity.util.UtilActivity;
import org.vartist.atld.menu.consts.MenuConst;
import org.vartist.atld.menu.vo.MenuVO;

import android.app.Activity;

public class MenuGenerator {

	public static ArrayList<MenuVO> makeMenuList(Activity activity) {
		
		ArrayList<MenuVO> menuList = new ArrayList<MenuVO>();
		MenuVO menuVO = null;

		/***
		 * create MainActivity's menu list 
		 */
		if (activity instanceof MainActivity) {
			
			//01.Util
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_1st);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_util_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_util_path));
			menuList.add(menuVO);
			
			//02.View
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_1st);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_view_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_view_path));
			menuList.add(menuVO);

		}
		
		/***
		 * create SubDept1stClazzesActivity's menu list
		 */
		else if (activity instanceof UtilActivity) {
			
			//01.01.Base64
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_2nd);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_util_base64_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_util_base64_path));
			menuList.add(menuVO);
			
			//01.02.Calendar
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_2nd);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_util_calendar_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_util_calendar_path));
			menuList.add(menuVO);
			
			//01.03.DataBase
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_2nd);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_util_database_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_util_database_path));
			menuList.add(menuVO);
			
			//01.04.Device
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_2nd);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_util_device_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_util_device_path));
			menuList.add(menuVO);
			
			//01.05.Encrypt
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_2nd);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_util_encrypt_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_util_encrypt_path));
			menuList.add(menuVO);
			
			//01.06.File
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_2nd);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_util_file_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_util_file_path));
			menuList.add(menuVO);
			
			//01.07.Image
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_2nd);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_util_image_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_util_image_path));
			menuList.add(menuVO);
			
			//01.08.Log
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_2nd);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_util_log_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_util_log_path));
			menuList.add(menuVO);
			
			//01.09.Network
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_2nd);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_util_network_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_util_network_path));
			menuList.add(menuVO);
			
			//01.10.SharedPreference
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_2nd);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_util_sharedpreference_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_util_sharedpreference_path));
			menuList.add(menuVO);
			
			//01.11.Text
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_2nd);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_util_text_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_util_text_path));
			menuList.add(menuVO);
			
			//01.12.UI
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_2nd);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_util_ui_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_util_ui_path));
			menuList.add(menuVO);
			
			//01.12.UI
			menuVO = new MenuVO();
			menuVO.setMenuDept(MenuConst.CONST_MENU_DEPT_2nd);
			menuVO.setMenuIcon(R.drawable.icon_point);
			menuVO.setMenuName(activity.getString(R.string.menu_util_audio_name));
			menuVO.setMenuType(0);
			menuVO.setMenuMoreIcon(R.drawable.icon_more);
			menuVO.setForwardActivityName(activity.getPackageName() + activity.getString(R.string.menu_util_audio_path));
			menuList.add(menuVO);
		}
		
		return menuList;
	}

}
